<template>
  <div class="login">
    <el-form class="login-form">
      <img class="login-img" src="../../assets/logo.png" />
      <el-form-item prop="username">
        <el-input v-model="loginForm.username" placeholder="账号">
          <template #prefix>
            <i class="el-input__icon el-icon-user-solid" style="color:#333"></i>
          </template>
        </el-input>
      </el-form-item>
      <el-form-item prop="password">
        <el-input v-model="loginForm.password" placeholder="密码">
          <template #prefix>
            <i class="el-input__icon el-icon-s-goods" style="color:#333"></i>
          </template>
        </el-input>
      </el-form-item>
      <el-form-item style="width:100%;">
        <el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
          <span v-if="!loading">登 录</span>
          <span v-else>登 录 中...</span>
        </el-button>
      </el-form-item>

    </el-form>
  </div>
</template>
<script>
export default {
  name: "Login",//登录
  data() {
    return {
      loginForm: {
        username: '',
        password: '',
        rememberMe: false,
        code: '',
        uuid: ''
      },
      loading:false,
    }
  },
  methods: {
    handleLogin(){
      console.log("登录")
      this.$router.push('/')
    }
  }
}
</script>
<style lang="scss" scoped>
.login {
  background: rgb(32, 47, 70);

  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;

  .login-form {
    width: 385px;
    background: #fff;
    padding: 20px;
    text-align: center;
    .login-img {
      width: 100px;
    }
  }
}
</style>